home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / cnet / viewlog.lha / viewlog5 / VL_SysOpLog < prev    next >
Text File  |  1996-11-03  |  20KB  |  389 lines

  1. /**************************************************************************\
  2.             $VER: SysOp View Log, v5.01 (3-Nov-96) by Dotoran!
  3. \**************************************************************************/
  4. options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; mg=maygetchar
  6. a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
  7.  
  8. START:;ver="5.01";changewhere "SysOpViewLog"ver
  9. tr "f1n3cfSysOp cbView Logc6, c7vcf"ver"c6!"
  10. se "n1caInitializingc6...c9" ; tw=0 ; zy=0 ; call SETUP
  11. call READCONFIG ; call CHECKVER ; call READTITLES ; call READDATA
  12. lo=1 ; hi=45 ; if hi>logs then hi=logs
  13.  
  14. BEGIN: ; row=1 ; col=1 ; cols="12 32 52" ; r=1
  15.   tr "f1@4 ÉÍMenuÍÍÍÍÍÄSysOp View Logv"ver" by Dotoran of Frontiers BBS <ÄÍÍÍÍÍÍÍÍÍÍ»"
  16.   tr " ÈÍÍ» ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ÉÍͼ"
  17.   tr " ÉÍͼ ÛÛßCßÛÛ ÈÍÍ»";tr " ÈÍÍ» ÛÛCÛÛ ÉÍͼ"
  18.   do 7;tr " ÉÍͼ ÛÛCÛÛ ÈÍÍ»";tr " ÈÍÍ» ÛÛCÛÛ ÉÍͼ";end
  19.   tr " ÉÍͼ ÛÛÜCÜÛÛ ÈÍÍ»";tr " ÈÍÍ» ÛÛÛÛÛÛÛ             ÛÛÛÛÛÛ<R>ead ALL LogsÛÛÛÛ             ÛÛÛÛÛÛÛÛÛ ÉÍͼ"
  20.   tr " ÉÍͼ <ENTER>=View Log<h>=View History<ESC>=Toggle ALL Menu<c>onfig ÈÍÍ»"
  21.   tr " º    <d/D>=Delete Log/History<t/T>=Trim Log/History<m>aint<a>maint    º"
  22.   tr " ÈÍÄ>   <u>ser Log Viewer, use Arrow Keys to Move, or press <qto Quit!  <Äͼ"
  23.  
  24. VIEWANS:
  25.   do i=lo to hi by 3 ; i2=i+1 ; i3=i+2
  26.     c="ca" ; if r/2=r%2 then c="cb"
  27.     se ""r+3";12H"c||center(logN.i,17)
  28.     se ""r+3";32H"c||center(logN.i2,17)
  29.     se ""r+3";52H"c||center(logN.i3,17)
  30.     r=r+1
  31.   end i
  32.   if lo>1&hi<90 then do ; do i=hi to 90 by 3
  33.     tr ""r+3";13H"sp ; r=r+1 ; end i ; end
  34.   se "4Hz7c5<c0* c1= c4Log c1existsc4, c0H c1= c4History c1existsc4, c0*H c1= c4Both c1existc5>z0"
  35.   if hi<logs then do
  36.     se "13Hz7             53Hc1<c0Nc1>c0ext Screenz0";end
  37.   if lo>1 then do
  38.     se "13Hz7c1<c0Pc1>c0ast Screen53H             z0";end
  39. VIEWANS2: ; z=LOC() ; ex1=" ";if exF.z=1 then ex1="*"
  40.   ex2=" ";if exH.z=1 then ex2="H"
  41.   tr ""row+3";"word(cols,col)"Hz1ce"ex1||ex2||center(logN.z,13)ex2||ex1"z0"
  42.   se "9H";do until k~="NOCHAR";call CHECK;mg;k=result;end;kk=""
  43.   if k=d2c(27) then do;do 2;mg;kk=result;end;end
  44.  
  45.   if c2d(k)=27 & kk="NOCHAR" then signal MENU_ON
  46.  
  47.   if upper(k)="Q" then do
  48.     se "11HcdQuit cfSysOp c9ViewLog c6 right now? cb[caYescb]c6: "
  49.     gc;a=result;if a="N" then tr "c9Noc6.";else do;tr "caYesc6!"
  50.       se "22HcbThanks c6for using caView Log c6today!";call MAKELOG;exit;end
  51.     tr "11H"sp;signal VIEWANS2;end
  52.  
  53.   if (kk~="NOCHAR" & kk>"") | index("2468",k)>0 then do ; c="ca" ; if row/2=row%2 then c="cb"
  54.     tr ""row+3";"word(cols,col)"H"c||center(logN.z,17);oldz=z
  55.     if k=8 | kk="A" then do ; row=row-1 ; if row<1 then do ; row=16
  56.       do until logN.z>"" ; row=row-1 ; z=LOC() ; end ; end
  57.       signal VIEWANS2;end
  58.     if k=2 | kk="B" then do ; row=row+1 ; z=LOC()
  59.       if logN.z="" | row>15 then row=1
  60.       signal VIEWANS2;end
  61.     if k=6 | kk="C" then do ; col=col+1 ; z=LOC()
  62.       if logN.z="" | col>3 then col=1
  63.       signal VIEWANS2;end
  64.     if k=4 | kk="D" then do ; col=col-1 ; if col<1 then do ; col=4
  65.       do until logN.z>"" ; col=col-1 ; z=LOC() ; end ; end
  66.       signal VIEWANS2;end ; end
  67.  
  68.   if c2d(k)=13 & exF.z=1 then do ; a=logI.z
  69.     if ar=1 then do ; call setclip("ARt",title.a) ; call setclip("ARi",a)
  70.       se "H#0"ARpt" sysdata:log/"logF.z",,,,,1,e,1,0}"
  71.       call setclip("ARt") ; call setclip("ARi") ; end
  72.     else do ; tr "f1c6Now cbViewing c6the cf`ca"logN.z"cf' c6logc9:"
  73.       if title.a>"" then tr "n1z5ce"left(title.a,79)"z0"
  74.       tr "*0 SysData:Log/"logF.z"}"
  75.       se "c7<c6Press cdANY KEY c6Nowc7>g1" ; end
  76.     signal BEGIN ; end
  77.  
  78.   if upper(k)="H" & exH.z=1 then do ; a=logI.z
  79.     if ar=1 then do ; call setclip("ARt",title.a) ; call setclip("ARi",a)
  80.       se "H#0"ARpt" "comP"Histories/"logF.z",,,,,1,e,1,0}"
  81.       call setclip("ARt") ; call setclip("ARi") ; end
  82.     else do ; tr "f1c6Now cbViewing c6the cf`ca"logN.z"cf' c6log cehistoryc9:"
  83.       if title.a>"" then tr "n1z5ce"left(title.a,79)"z0"
  84.       tr "*0 "comP"histories/"logF.z"}"
  85.       se "c7<c6Press cdANY KEY c6Nowc7>g1" ; end
  86.     signal BEGIN ; end
  87.  
  88.   if upper(k)="N"&lo=1 then do;lo=lo+45;hi=hi+45;if hi>logs then hi=logs
  89.     row=1;col=1;r=1;signal VIEWANS;end
  90.   if upper(k)="P"&hi=logs then do;lo=1;hi=45;if hi>logs then hi=logs
  91.     row=1;col=1;r=1;signal VIEWANS;end
  92.   if upper(k)="R" then do;it=1;signal MENU2;end
  93.  
  94.   if k="t" & exF.z=1 then do ; if sysM.z=1 & id~=1 then do
  95.       se "11Hc6Only ce"sysop" c6can c9trim c6the cf`cd"logN.z"cf' c6log. c7<cckeyc7>g111H"sp
  96.       signal VIEWANS2;end
  97.     se "11Hc9Trim cf`cd"logN.z"cf' c6log to ca"trln.z" c6lines? cb[caYescb]c6: "
  98.     gc;a=result;if a="N" then do;tr "c9Noc6.";end;else do;se "caYesc6, c9Trimmingc6..."
  99.       call open(f1,"sysdata:log/"logF.z,"r")
  100.         do i=1 until eof(f1) ; se "c9"TWIRL() ; l.i=readln(f1) ; end i ; l=i-1
  101.       call close(f1)
  102.       if l>trln.z then do
  103.         call LOG("[S] Trimmed "l-trln.z" lines from the `"logN.z"' log file.")
  104.         call open(f1,"sysdata:log/"logF.z,"w")
  105.           do i=l-trln.z+1 to l ; se "cf"TwIRL() ; call writeln(f1,l.i) ; end i
  106.         call close(f1) ; end
  107.       if logH.z=1 & l>trln.z then do
  108.         call LOG("[S] Appended "l-trln.z" lines to the `"logN.z"' log history.")
  109.         call open(f1,comP"Histories/"logF.z,substr("wa",exH.z+1,1))
  110.           do i=1 to l-trln.z ; se "cc"TWIRL()
  111.           call writeln(f1,l.i) ; end i ; call close(f1) ; exH.z=1
  112.       end ; tr "h7c9edc6!"
  113.     end ; tr "11H"sp
  114.     signal VIEWANS2;end
  115.  
  116.   if k="T" & exH.z=1 then do ; if hisT.z=0 then do
  117.     se "11Hc6The cf`cd"logN.z"cf' c6history is cfprotected c6from c9trimmingc6. c7<cckeyc7>g1"
  118.     tr "11H"sp;signal VIEWANS2;end ; if sysM.z=1 & id~=1 then do
  119.       se "11Hc6Only ce"sysop" c6can c9trim c6the cf`cd"logN.z"cf' c6history. c7<cckeyc7>g111H"sp
  120.       signal VIEWANS2;end
  121.     se "11Hc9Trim cf`cd"logN.z"cf' c6history to ca"hisT.z" c6lines? cb[caYescb]c6: "
  122.     gc;a=result;if a="N" then do;tr "c9Noc6.";end;else do;se "caYesc6, c9Trimmingc6..."
  123.       call open(f1,comP"Histories/"logF.z,"r")
  124.         do i=1 until eof(f1) ; se "c9"TWIRL() ; l.i=readln(f1) ; end i ; l=i-1
  125.       call close(f1)
  126.       if l>hisT.z then do
  127.         call LOG("[S] Trimmed "l-trln.z" lines from the `"logN.z"' log history.")
  128.         call open(f1,comP"Histories/"logF.z,"w")
  129.           do i=l-hisT.z+1 to l ; se "cc"TWIRL() ; call writeln(f1,l.i) ; end i
  130.         call close(f1) ; end ; tr "h7c9edc6!"
  131.     end ; tr "11H"sp
  132.     signal VIEWANS2;end
  133.  
  134.   if k="d" & exF.z=1 then do ; if sysM.z=1 & id~=1 then do
  135.       se "11Hc6Only ce"sysop" c6can c9delete c6the cf`cd"logN.z"cf' c6log. c7<cckeyc7>g111H"sp
  136.       signal VIEWANS2;end
  137.     se "11Hc9Delete cf`cd"logN.z"cf' c6log now? cb[c9Nocb]c6: "
  138.     gc;a=result;if a="Y" then do;se "caYesc6, "
  139.     if logH.z=1 then do ; se "cfSaving cdHistoryc6...cc"
  140.       call LOG("[S] Saved the `"logN.z"' log file to history.")
  141.       call open(f1,"SysData:Log/"logF.z,"r")
  142.       call open(f2,comP"Histories/"logF.z,substr("wa",exists(comP"Histories/"logF.z)+1,1))
  143.         do i=1 until eof(f1) ; se TWIRL() ; a=readln(f1) ; call writeln(f2,a) ; end i
  144.       call close(f2)
  145.       call close(f1)
  146.       se "h8h9" ; exH.z=1
  147.     end ; se "c9Deletingc6...";exF.z=0
  148.     call LOG("[S] Deleted the `"logN.z"' log file.")
  149.     address command "delete SysData:Log/"logF.z;tr "h6c9edc6!";end;else tr "c9Noc6."
  150.     tr "11H"sp;signal VIEWANS2;end
  151.  
  152.   if k="D" & exH.z=1 then do ; if sysM.z=1 & id~=1 then do
  153.       se "11Hc6Only ce"sysop" c6can c9delete c6the cf`cd"logN.z"cf' c6history. c7<cckeyc7>g111H"sp
  154.       signal VIEWANS2;end
  155.     se "11Hc9Delete c6the cf`cd"logN.z"cf' c6history now? cb[c9Nocb]c6: "
  156.     gc;a=result;if a="Y" then do;se "caYesc6, c9Deletingc6...";exH.z=0
  157.     call LOG("[S] Deleted the `"logN.z"' log history.")
  158.     address command "delete "comP"Histories/"logF.z;tr "h6c9edc6!";end;else tr "c9Noc6."
  159.     tr "11H"sp;signal VIEWANS2;end
  160.  
  161.   if upper(k)="A" then do
  162.     se "11Hc6Run ceViewLog5 cdAutoMaintenance c6right now? cb[c9Nocb]c6: "
  163.     gc;a=result;if a="Y" then do;se "caYesc6!#0"comP"VL_AMaint}";signal BEGIN;end
  164.     else tr "c9Noc6.11H"sp;signal VIEWANS2;end
  165.   if upper(k)="M" then do
  166.     se "11Hc6Load ceViewLog5 cdMaintenance c6module now? cb[c9Nocb]c6: "
  167.     gc;a=result;if a="Y" then do;se "caYesc6!#0"comP"VL_Maint}";signal BEGIN;end
  168.     else tr "c9Noc6.11H"sp;signal VIEWANS2;end
  169.   if upper(k)="C" then do
  170.     se "11Hc6Load ceViewLog5 cdConfig c6module now? cb[c9Nocb]c6: "
  171.     gc;a=result;if a="Y" then do;se "caYesc6!#0"comP"VL_Config}";signal BEGIN;end
  172.     else tr "c9Noc6.11H"sp;signal VIEWANS2;end
  173.   if upper(k)="U" then do
  174.     se "11Hc6Load ceViewLog5 cdUserLog c6module now? cb[c9Nocb]c6: "
  175.     gc;a=result;if a="Y" then do;se "caYesc6!#0"comP"VL_UserLog}";signal BEGIN;end
  176.     else tr "c9Noc6.11H"sp;signal VIEWANS2;end
  177.  signal VIEWANS2
  178.  
  179. LOC: ; return (row*3+col-3)+(45*(lo>1))
  180.  
  181. SETUP:
  182.   it=7 ; max=7
  183.   it.1="3H View ALL Log Files"
  184.   it.2="3H View ALL Histories"
  185.   it.3="3H Trim ALL Log Files"
  186.   it.4="3H Trim ALL Histories"
  187.   it.5="3H Delete ALL Log Files"
  188.   it.6="3H Delete ALL Histories"
  189.   it.7="3H Quit & Exit ViewLog"
  190.   gu 40 ; id=result ; bbsidentify sysop ; sysop=result
  191.   sp=copies(" ",59)
  192.  return
  193.  
  194. READCONFIG:;gu 1311992;comP=result
  195.   call open(f1,comP"ViewLog5.cfg","r")
  196.     vers=readln(f1) ; macc=readln(f1)
  197.     uacc=readln(f1) ; trim=readln(f1) ; trln=readln(f1)
  198.     logH=readln(f1) ; hisP=readln(f1) ; hisT=readln(f1)
  199.     ETex=readln(f1)
  200.     ARus=readln(f1);AR=readln(f1);ARpt=readln(f1)
  201.   call close(f1)
  202.  return
  203.  
  204. READDATA: ; gu 15 ; ac=result ; acF.=0 ; exF.=0
  205.   if ~exists(comP"VL_Data") then do
  206.     se "n1c9I'm sorry, but you forgot to run the Maintenance module for "
  207.     tr "ViewLog first!";exit;end
  208.   se "n1cbReading c6Logsc9: cf[cd000cf]<4"
  209.   call open(f1,comP"VL_Data","r") ; logN.="" ; logs=0
  210.     do i=1 until eof(f1) ; log.i=readln(f1) ; se "cd"right("cb"i-1,6,"0")"<3"
  211.       parse var log.i 1 logI.i . 5 logN.i . 20 logF.i . 35 uacc.i .,
  212.                       50 uac.i"  " 138 trim.i . 140 trln.i . 143 logH.i .,
  213.                       145 hisT.i . 149 sysM.i . 151 asoc.i
  214.       exF.i=exists("SysData:Log/"logF.i)
  215.       exH.i=exists(comP"Histories/"logF.i)
  216.     end i ; logs=i-1
  217.   call close(f1)
  218.  return
  219.  
  220. READTITLES:
  221.   call open(f1,comP"VL_Titles","r") ; title.=""
  222.     do i=1 until eof(f1) ; a=readln(f1) ; se TWIRL()
  223.       parse var a 1 v1 . 5 v2 . 17 v3 ; title.v1=v3 ; end i ; titles=i-1
  224.   call close(f1) ; tr "cdDonec6!"
  225.  return
  226.  
  227. CHECKVER: ; if ver=vers then return
  228.   tr "n2Version Conflict:n1"
  229.   tr "   `ViewLog5.cfg' version: v"vers
  230.   tr "   `VL_SysOpLog'  version: v"ver
  231.   tr "n1   BOTH files above need to be v"max(ver,vers)"!"
  232.   tr "n1Halting, due to conflicting versions..."
  233.  exit
  234.  
  235. TWIRL:;sh="--\\||//";tw=tw+1;if tw>8 then tw=1;return substr(sh,tw,1)"<1"
  236.  
  237. LOG:;parse arg text;zy=zy+1;text.zy="AUTO: ("date("u")" "time("c")")"text;return
  238. MAKELOG:;call open(f9,"SysData:Log/ViewLog5",substr("wa",exists("sysdata:log/viewlog5")+1,1))
  239.  do i=1 to zy;call writeln(f9,text.i);end i;call close(f9);return
  240.  
  241. MENU: ; se "z5ce"left(it.it,29)"z09H"
  242.   do until k~="NOCHAR";mg;k=result;end;kk=""
  243.   if c2d(k)=27 then do;do 2;mg;end;kk=result;end
  244.   if c2d(k)=27&kk="NOCHAR" then signal MENU_OFF
  245.   if kk="B"|kk="C" then do;tr "z0cd"left(it.it,29)
  246.     it=it+1;if it>max then it=1;signal MENU;end
  247.   if kk="A"|kk="D" then do;tr "z0cd"left(it.it,29)
  248.     it=it-1;if it<1 then it=max;signal MENU;end
  249. MENU2:
  250.   if it=1 then do /* View ALL Log Files */
  251.     se "11HcdView cfALL c6logs right now? cb[c9Nocb]c6: "
  252.     gc;a=result;if a~="Y" then tr "c9Noc6.";else do;tr "caYesc6!"
  253.     do i=1 to logs ; if exF.i=0 then iterate i ; else a=logI.i
  254.       if ar=1 then do ; call setclip("ARt",title.a) ; call setclip("ARi",a) ; call setclip("ARa","1")
  255.         se "H#0"ARpt" sysdata:log/"logF.i",,,,,1,e,1,0}" ; changewhere "SysOpViewLog5.0"
  256.         call setclip("ARt") ; call setclip("ARi") ; call setclip("ARa") ; end
  257.       else do ; tr "f1c6Now cbViewing c6the cf`ca"logN.i"cf' c6logc9:"
  258.         if title.a>"" then tr "n1z5ce"left(title.a,79)"z0"
  259.         tr "*0 SysData:Log/"logF.i"}" ; end
  260.       se "2Hz7c1Press <Q>uit, or ANY OTHER KEY for next log...z0"
  261.       gc;a=result;if a="Q" then leave i ; else tr "Hz7z0"
  262.     end i ; signal BEGIN ; end ; tr "11H"sp
  263.     if menu=1 then call MENU_OFF ; signal VIEWANS2 ; end
  264.  
  265.   if it=2 then do /* View ALL Histories */
  266.     se "11HcdView cfALL c6log histories right now? cb[c9Nocb]c6: "
  267.     gc;a=result;if a~="Y" then tr "c9Noc6.";else do;tr "caYesc6!"
  268.     do i=1 to logs ; if exH.i=0 then iterate i ; else a=logI.i
  269.       if ar=1 then do ; call setclip("ARt",title.a) ; call setclip("ARi",a) ; call setclip("ARa","1")
  270.         se "H#0"ARpt" "comP"Histories/"logF.i",,,,,1,e,1,0}"
  271.         call setclip("ARt") ; call setclip("ARi") ; call setclip("ARa") ; end
  272.       else do ; tr "f1c6Now cbViewing c6the cf`ca"logN.i"cf' c6log cehistoryc9:"
  273.         if title.a>"" then tr "n1z5ce"left(title.a,79)"z0"
  274.         tr "*0 "comP"histories/"logF.i"}" ; end
  275.       se "2Hz7c1Press <Q>uit, or ANY OTHER KEY for next history...z0"
  276.       gc;a=result;if a="Q" then leave i ; else tr "Hz7z0"
  277.     end i ; signal BEGIN ; end ; tr "11H"sp
  278.     call MENU_OFF ; signal VIEWANS2 ; end
  279.  
  280.   if it=3 then do /* Trim ALL Logs */
  281.     se "11Hc9Trim cfALL c6logs to carespective c6lengths? cb[c9Nocb]c6: "
  282.     gc;a=result;if a~="Y" then tr "c9Noc6.";else do;tr "caYesc6!"
  283.     do i=1 to logs ; if exF.i=0 | (sysM.i=1 & id~=1) then iterate i
  284.       se "11H"sp"11Hc9Trimming cf`cd"logN.i"cf' c6log to ce"trln.i" c6lines..."
  285.       call open(f1,"sysdata:log/"logF.i,"r")
  286.         do j=1 until eof(f1) ; se "c9"TwIRL() ; l.j=readln(f1) ; end j ; l=j-1
  287.       call close(f1)
  288.       if l>trln.i then do
  289.         call LOG("[A] Trimmed "l-trln.i" lines from the `"logN.i"' log file.")
  290.         call open(f1,"sysdata:log/"logF.i,"w")
  291.           do j=l-trln.i+1 to l ; se "cf"TwIRL() ; call writeln(f1,l.j) ; end j
  292.         call close(f1) ; end
  293.       if logH.i=1 & l>trln.i then do
  294.         call LOG("[A] Appended "l-trln.i" lines to the `"logN.i"' log history.")
  295.         call open(f1,comP"Histories/"logF.i,substr("wa",exH.i+1,1))
  296.           do j=1 to l-trln.i ; se "cc"TWIRL()
  297.           call writeln(f1,l.j) ; end j ; call close(f1) ; exH.i=1
  298.       end ; tr "cdDonec6!"
  299.     end i ; end ; tr "11H"sp ; call MENU_OFF
  300.     signal VIEWANS2;end
  301.  
  302.   if it=4 then do /* Trim ALL Histories */
  303.     se "11Hc9Trim cfALL c6log histories to carespective c6lengths? cb[c9Nocb]c6: "
  304.     gc;a=result;if a~="Y" then tr "c9Noc6."
  305.     else do;tr "caYesc6!"
  306.       do i=1 to logs
  307.         if exH.i=0 | (sysM.i=1 & id~=1) | hisT.i=0 then iterate i
  308.         se "11H"sp"11Hc9Trimming cf`cd"logN.i"cf' c6history to ce"hisT.i" c6lines..."
  309.         call open(f1,comP"Histories/"logF.i,"r")
  310.           do j=1 until eof(f1) ; se "c9"TWIRL() ; l.j=readln(f1) ; end j ; l=j-1
  311.         call close(f1)
  312.         if l>hisT.i then do
  313.           call LOG("[A] Trimmed "l-hisT.i" lines from the `"logN.i"' log history.")
  314.           call open(f1,comP"Histories/"logF.i,"w")
  315.             do j=l-hisT.i+1 to l ; se "cc"TWIRL() ; call writeln(f1,l.j) ; end j
  316.           call close(f1) ; end ; tr "cdDonec6!"
  317.       end i ; end ; tr "11H"sp ; call MENU_OFF
  318.     signal VIEWANS2;end
  319.  
  320.   if it=5 then do /* Delete ALL Log Files */
  321.     se "11Hc6You want to c9Delete cfALL c6logs now? cb[c9Nocb]c6: "
  322.     gc;a=result ; if a="Y" then do;se "caYes"
  323.       do i=1 to logs ; se "11H"sp"11H"
  324.         if exF.i=1 & sysM.i=0 | (sysM.i=1 & id=1) then do ; exF.i=0
  325.           if logH.i=1 then do ; se "cbSaving cf`cd"logN.i"cf' c6to cfhistoryc6...cc"
  326.             call open(f1,"SysData:Log/"logF.i,"r")
  327.             call open(f2,comP"Histories/"logF.i,substr("wa",exists(comP"Histories/"logF.i)+1,1))
  328.               do j=1 until eof(f1) ; se TWIRL() ; a=readln(f1) ; call writeln(f2,a) ; end j
  329.             call close(f2) ; call close(f1) ; end
  330.           se "c9Deletingc6..." ; exF.z=0
  331.           call LOG("[A] Deleted the `"logN.i"' log file.")
  332.           address command "delete SysData:Log/"logF.i
  333.           tr "h6c9edc6!" ; end ; end i ; end ; else tr "c9Noc6."
  334.         tr "11H"sp;call MENU_OFF;signal VIEWANS2 ; end
  335.  
  336.   if it=6 then do /* Delete ALL Histories */
  337.     se "11Hc6You want to c9Delete cfALL c6log histories now? cb[c9Nocb]c6: "
  338.     gc;a=result;if a="Y" then do;se "caYesc6..."
  339.     do i=1 to logs ; if exH.i=0 | (sysM.i=1 & id~=1) then iterate i
  340.       se "11H"sp"11Hc9Deleting cf`ce"logN.i"cf'c6..."
  341.       exH.i=0 ; address command "delete "comP"histories/"logF.i
  342.       call LOG("[A] Deleted the `"logN.i"' log history.")
  343.     end i ;end;else tr "c9Noc6."
  344.     tr "11H"sp;call MENU_OFF;signal VIEWANS2;end
  345.  
  346.   if it=7 then do /* Quit & Exit ViewLog */
  347.     se "22HcbThanks c6for using caView Log c6today!";call MAKELOG;exit;end
  348.  
  349.  signal MENU
  350.  
  351. MENU_ON:;menu=1
  352.   tr "f0 ÉÍMenuÍÍÍÍÍÄSysOp Vie"
  353.   tr " º    ÛÛÛÛÛÛ <Log ex"
  354.   tr " º"copies(" ",22)"º"
  355.   tr " º View ALL Log Files   º"
  356.   tr " º View ALL Histories   º"
  357.   tr " º"copies(" ",22)"º"
  358.   tr " º Trim ALL Log Files   º"
  359.   tr " º Trim ALL Histories   º"
  360.   tr " º"copies(" ",22)"º"
  361.   tr " º Delete ALL Log Files º"
  362.   tr " º Delete ALL Histories º"
  363.   tr " º"copies(" ",22)"º"
  364.   tr " º Quit & Exit ViewLog  º"
  365.   tr " ÈÍÍËÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"
  366.  signal MENU
  367.  
  368. MENU_OFF:;menu=0;mo="1 4 7 10 13 16 19 22 25 28 31"
  369.   if lo>1 then mo="46 49 52 55 58 61 64 67 70 73 76"
  370.   do i=14 to 4 by -1 ; j=i-1 ; z1=word(mo,i-3) ; z2=word(mo,j-3)
  371.     tr ""i";1H ccÈÍÍ» c7ÛÛ    ca"center(logN.z1,15)
  372.     tr ""j";1H ccÉÍͼ c7ÛÛ    cb"center(logN.z2,15)
  373.     i=i-1
  374.   end i
  375.   tr "H ccÉÍͼ c7ÛÛß"copies(" ",20)
  376.   tr "H ccÈÍÍ»";tr "H ccÉÍMenu"
  377.  signal VIEWANS2
  378.  
  379. CHECK:;getcarrier;if result="TRUE" then return;else a="Lost Carrier!"
  380.   tr "1Hc9"a;logentry a;call MAKELOG;bufferflush;exit
  381.  
  382. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')'
  383.   e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960
  384.   b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
  385.   e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3
  386.   logentry e3;e=substr(e,38);end;call MAKELOG;bufferflush;exit
  387. /**************************************************************************\
  388. \****************************************** Frontiers BBS (716)/823-9892 **/
  389.